<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>我发起的维权 - 交易维权- 用户中心</title>

  {include file="public/css"}
</head>
<body>

<!-- 头部开始 -->
{include file="public/header"}
<!-- 头部结束 -->




<!-- 会员中心导航菜单 -->
<div class="layui-main fly-marginTop fly-user-main ">
<div class="user-left-menu" style="">
{include file="public/left_menu"}

</div>
        <div class="fly-panel fly-panel-user user-right-content" pad20>

        <div class="layui-tab layui-tab-brief" lay-filter="user">
            <ul class="layui-tab-title" id="LAY_mine">
              <li data-type="mine-jie" lay-id="index" class="layui-this">维权管理</li>
             
            </ul>
            <div class="layui-tab-content" style="padding: 20px 0;">
                <div class="layui-tab-item layui-show">
                <form class="layui-form" action="">
                     <div class="layui-form-item">
                      <label class="layui-form-label">状态</label>
                      <div class="layui-input-inline" style="width:200px">
                        <select name="status" lay-verify="required">
                          <option value=""></option>
                          <option value="0">待处理</option>
                          <option value="1">已处理</option>
                          <option value="2">未成立</option>
                        </select>
                      </div>
                        <div class="layui-input-inline">
                          <button class="layui-btn layui-btn-normal" lay-submit lay-filter="form">搜索</button>
                        
                        </div>
                    </div>
           
              
              </form>
                  
              
                <!-- 表格内容 -->
                 <div class="layui-row">            
                   <table id="table"></table>
                </div>   

           </div>
           </div>
        </div>
        </div>
    
</div>
<!-- 会员底部文件 -->
{include file="public/footer"}



{include file="public/js"}

<script>

layui.use(['form','layer','table','laypage','laydate'], function(){
  var form = layui.form;
  var laypage = layui.laypage; 
  var laydate = layui.laydate;
  var table = layui.table;
  var layer = layui.layer;

 ajax_table();
  //监听提交
  form.on('submit(form)', function(data){
     var where = data.field;
     ajax_table(where);
    return false;
  });

// 时间设置 
 laydate.render({
    elem: '#start' //指定元素
    ,theme: '#1290f5'
      ,lang:'cn'
  });
laydate.render({
    elem: '#end' //指定元素
    ,theme: '#1290f5'
      ,lang:'cn'
  });

//获得数据表格函数
function ajax_table(where=""){
     table.render({
      elem: '#table'
      ,limit:10
      // ,width:910
      // ,height:515
      ,where:where
      ,url: '{:url("rights/myRights")}' //数据接口
      ,page: {layout:['prev', 'page', 'next']} //开启分页
      ,loading:false

      ,skin: 'line' //行边框风格
         ,text: {
      none: "没有更多数据" //默认：无数据。注：该属性为 layui 2.2.5 开始新增
      }
    ,even: true //开启隔行背景
    ,size: 'lg' //小尺寸的表格
      ,cols: [[ //表头
      {field: 'id', title: "编号", width:80,sort: true}
      ,{field: 'title', title: "订单名称", width:150,templet: '#orderTitleTpl'}
      ,{field: 'to_user', title: "被维权对象", width:150}
      ,{field: 'content', title: "举报原因", width:150}
      ,{field: 'images_url', title: "举报图片", width:150,templet: '#imagesTpl'}
      ,{field: 'create_time', title: "举报时间", width:100} 
      ,{field: 'status', title: "状态", width:80,templet: '#statusTpl'}
      ,{field: 'result', title: "处理结果", width:150} 
      
      ]]
    });
}

});
</script>
<script type="text/html" id="statusTpl">
  {{#  if(d.status == 0){ }}
    待处理

  {{#  } else if(d.status == 1){ }}
    已处理
  {{#  } else if(d.status == 2){ }}
    未成立
  {{#  } }}
</script>


<script type="text/html" id="imagesTpl">



<img src="{{d.image_url}}"  onclick="show('{{d.image_url}}')"  >

</script>
<script>
function show(content){
  layer.open({
  type: 1,
  title:false,
  skin: 'layui-layer-rim', //加上边框
  area: ['520px', '440px'], //宽高
  content:'<img src="'+content+'" style="width:100%">'
});
}
</script>
<script type="text/html" id="orderTitleTpl">
  <a href="/order/{{d.order_id}}.html" target="_blank">{{d.title}}</a>
</script>
</body>
</html>